package org.hdl.anima.message;


/**
 * 
 * @author qiuhd
 * @since  2014-2-18
 * @version V1.0.0
 */
public class ErrorResponse extends ResponseAdapter {
	
	public static ErrorResponse get(int errorCode,String error) {
		return new ErrorResponse(errorCode,error);
	}
	
	public static ErrorResponse get(int errorCode,Throwable t) {
		return new ErrorResponse(errorCode,t);
	}
	
	
	public ErrorResponse(Throwable t) {
		setErrorCode(BAD);
		setErrorDes(t.getMessage());
	}
	
	public ErrorResponse(String error) {
		setErrorCode(BAD);
		setErrorDes(error);
	}
	
	public ErrorResponse(int errorCode,String error) {
		setErrorCode(errorCode);
		setErrorDes(error);
	}
	
	public ErrorResponse(int errorCode,Throwable t) {
		setErrorCode(errorCode);
		setErrorDes(t.getMessage());
	}
}

